package jp.android_group.attender.android.net;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;

import jp.android_group.attender.android.entity.Attendee;
import jp.android_group.attender.android.entity.Event;

import org.apache.http.client.HttpResponseException;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

/*
 * Copyright (c) 2009, "Japan Android Group Attender Team"
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/**
 * サーバーインターフェース
 * 
 */
public interface IServerInterface {

	/**
	 * イベントデータの取得
	 * 
	 * @param authData
	 * @return
	 * @throws HttpResponseException
	 * @throws IOException
	 */
	public void getEvents(final SQLiteDatabase db)
			throws HttpResponseException, IOException;

	/**
	 * イベントデータの取得
	 * 
	 * @param authData
	 * @return
	 * @throws HttpResponseException
	 * @throws IOException
	 */
	public List<Event> getEventData() throws HttpResponseException, IOException;

	/**
	 * 参加者データの取得
	 * 
	 * @param authData
	 * @param eventData
	 * @return
	 * @throws HttpResponseException
	 * @throws IOException
	 */
	public void getAttendees(Event eventData, SQLiteDatabase db)
			throws HttpResponseException, IOException;

	/**
	 * 参加者データの取得
	 * 
	 * @param authData
	 * @param eventData
	 * @return
	 * @throws HttpResponseException
	 * @throws IOException
	 */
	public HashMap<String, Attendee> getAttendeeData(Event eventData)
			throws HttpResponseException, IOException;

	/**
	 * 参加者情報のアップロード
	 * 
	 * @param authData
	 * @param eventData
	 * @param attendeeDataList
	 * @return
	 * @throws HttpResponseException
	 * @throws IOException
	 */
	public void uploadAttendees(Event eventData, Cursor cursor,
			SQLiteDatabase db) throws HttpResponseException, IOException;

	/**
	 * @deprecated 参加者情報のアップロード
	 * @param authData
	 * @param eventData
	 * @param attendeeDataList
	 * @return
	 * @throws HttpResponseException
	 * @throws IOException
	 */
	public HashMap<String, Attendee> uploadAttendeeData(Event eventData,
			HashMap<String, Attendee> attendeeDataList)
			throws HttpResponseException, IOException;

}
